/**
 * DetailInfo组件用法
 * 组件引用方法：import XXX from '@/pages/Dashboard/common/DetailInfo';
 * 参数：
 * {array} props.infoData [{label: 'xxx', value: 'xxx', isStatus: true, isLine: true}]
 * isStatus: 默认不传，如果当前label为状态，需传入该字段，值为true
 * isLine: 默认不传，如果当前label为描述，需传入该字段，值为true，独占一行
 */
import React from 'react'
import './index.less'

const CommonDetailInfo = (props) => {
  return (
    <div className="common-detail-info">
      {
        props.infoData.length && props.infoData.map((item, index) => {
          return (
            <div className={item.isLine ? 'info-item info-line' : 'info-item'} key={index}>
              <div className="label">{item.label}</div>
              {
                item.isStatus
                  ? <div className="common">
                    <div className="common-success">{item.value}</div>
                  </div>
                  : <div className="value">{item.value}</div>

              }

            </div>
          )
        })
      }
    </div>
  )
}

export default CommonDetailInfo
